<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,minimum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<title>已签约信息</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/base64.min.js" type="text/javascript"></script>
<script src="js/layer/layer.js" type="text/javascript"></script>
<script src="js/max.borya_app.js" type="text/javascript"></script>
<script src="js/utils.js?123" type="text/javascript"></script>
<script src="js/pinchzoom.js" type="text/javascript"></script>
<style type="text/css">
body{height: auto;position:relative;}
.pinch-zoom,.pinch-zoom img{
    width: 100%;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
    user-drag: none;
}
</style>
</head>
<body>
<div class="m-img-box">
    <label class="org"></label>
    <label ></label>
</div>
<div class="m-img-box">
    <p class="img1  make_transist"></p>
    <p class="img2 hidescale"></p>
</div>
</body>
<script type="text/javascript">
Jsborya.ready(function(){
	 Jsborya.getUserInfo(function(data){
		var userInfo=JSON.parse(BASE64.decode(data)),json={
			'userInfo':userInfo
		};
		Utils.AJAX('../c/merchant/getInfo',json,function(data){
              initprotocolPic(data);
		},function(){
			Jsborya.webviewLoading({isLoad:false});//关闭app加载层
		},true);
	 });
});
$(function(){
    setTimeout(function(){
    $('div.pinch-zoom').each(function () {
        new RTP.PinchZoom($(this), {});
    });
    },3000)    
})
 
// JS实现选项卡切换 
window.onload=function(){
var label = document.querySelectorAll("label");
var imgB = document.querySelectorAll("p");
for(var i=0;i<label.length;i++){
    label[i].index = i;
    label[i].onclick=function(){ 
        var index = this.index;
        for(var i=0;i<label.length;i++){ 
            label[i].className="";
            imgB[i].className="hidescale make_transist";
        };
        label[index].className = 'org';
        imgB[index].className="showscale make_transist";
    };
    };
};

function initprotocolPic(data){
 	var attribute = data.data.merchant_attribute;
    var imgBox1 = document.getElementsByClassName('img1')[0];
    var newImg = document.createElement('img');
    var boxImg = document.createElement('div');
        boxImg.setAttribute("class","pinch-zoom")
    newImg.src=data.data.signMergePicture;
    boxImg.appendChild(newImg);
    imgBox1.appendChild(boxImg);
    if(attribute==3||attribute==4){
         var label = document.querySelectorAll("label");
         for(var i=0;i<label.length;i++){
            label[i].style.display='inline-block';
         };
          if(attribute==3){
 
             label[0].innerHTML = '远特协议';
             label[1].innerHTML = '联通协议';
            var imgBox2 = document.getElementsByClassName('img2')[0]; 
            var newImg2 = document.createElement('img');
            var boxImg = document.createElement('div');
                boxImg.setAttribute("class","pinch-zoom")
            newImg2.src='./imgs/联通合作协议.png';
            boxImg.appendChild(newImg2);
            imgBox2.appendChild(boxImg); 
            if(data.data.signOnlyPic!=""){
                var newImg3 = document.createElement('img');
                var boxImg = document.createElement('div');
                boxImg.setAttribute("class","pinch-zoom")
                newImg3.src=data.data.signOnlyPic;
                boxImg.appendChild(newImg3);
                imgBox2.appendChild(boxImg);
            }
          }else if(attribute==4){
             label[0].innerHTML = '联通协议';
             label[1].innerHTML = '远特协议';
            var imgBox2 = document.getElementsByClassName('img2')[0]; 
            imgBox2.style.display='block';
            var newImg2 = document.createElement('img');
            var boxImg = document.createElement('div');
                boxImg.setAttribute("class","pinch-zoom")
            newImg2.src='./imgs/代理商户合作协议1.png';
            boxImg.appendChild(newImg2);
            imgBox2.appendChild(boxImg);
            if(data.data.signOnlyPic!=""){
                var newImg3 = document.createElement('img');
                var boxImg = document.createElement('div');
                boxImg.setAttribute("class","pinch-zoom")
                newImg3.src=data.data.signOnlyPic;
                boxImg.appendChild(newImg3);
                imgBox2.appendChild(boxImg);
            }
          }
    }
};
</script>
</html>
